package com.taiyi.renaissancemall.ui.main.goodsdetail

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.taiyi.renaissancemall.R
import com.taiyi.renaissancemall.Utils.ToastUtils
import kotlinx.android.synthetic.main.activity_play_video.*

class PlayVideoActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_play_video)
        var videoUrl = intent.getStringExtra("videoUrl")
        videoView.setVideoPath(videoUrl)
        videoView.setOnPreparedListener {
            it.start()
        }
        videoView.setOnCompletionListener {
            ToastUtils.showLongToast("播放完成")
            finish()
        }
    }
}
